<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>自定义事件</title>
    <script src="../../vue.js"></script>
</head>
<body>

<script>
    var vm = new Vue({

        data :{'data':1},
        events : {
        'event.alert' : function() {
            alert('this is event alert :' + this.a);
            }
            }
});
vm.$emit('event.alert');
</script>
</body>
</html>